﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DingChiServiceApp
{
    public class DuplicateDao : SqlServerDao<Duplicate>, IDuplicateService
    {

        private readonly string tableName = "t_duplicate";

        public override string GetTableName()
        {
            return tableName;
        }

        /// <summary>
        /// 查找需要上传 的联单
        /// </summary>
        /// <param name="rows"> 条数 </param>
        /// <param name="upTime"> 上一次上传数据的时间 </param>
        /// <returns></returns>
        public List<Duplicate> SelectNeenUps(int rows,string upTime)
        {
            string sql = $"select  top({rows}) *  from {tableName} where create_time >= '{upTime}' or update_time >= '{upTime}' order by create_time asc;";
            var datas= Instance.Select<Duplicate>(sql);
            return datas;
        }
    }
}
